if (typeof(MyQEE) != 'object')
{
	var MyQEE = {};
}
MyQEE.userAgent = navigator.userAgent.toLowerCase();

MyQEE.is_firefox = MyQEE.userAgent.indexOf('firefox')>=0?true:false;
MyQEE.is_opera = navigator.appName.indexOf('Opera')>=0?true:false;
MyQEE.is_safari = MyQEE.userAgent.indexOf('safari')>=0?true:false;
MyQEE.is_ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
MyQEE.ie = (MyQEE.userAgent.indexOf('msie') != -1 && !MyQEE.is_opera) && MyQEE.userAgent.substr(MyQEE.userAgent.indexOf('msie') + 5, 3);

MyQEE.DOM = (document.compatMode &&document.compatMode=="CSS1Compat")?document.documentElement:document.body;

MyQEE.$ = function(el){return document.getElementById(el);}
var $ = MyQEE.$;

/**
 * 脚本调试，支持多参数输出，可在firebug中控制台查看
 * @return
 */
var trace = function(){
	if (typeof console == 'undefined'){
		return false;
	}
	if (arguments.length>1){
		console.group('Debug',123,456);
	}
	for(var i=0;i<arguments.length;i++){
		console.info(arguments[i])
	}
	if (arguments.length>1){
		console.groupEnd();
	}
}

if (typeof console == 'undefined'){
	console = {
		'error' : function(){},
		'debug' : function(){},
		'info' : function(){},
		'log' : function(){},
		'warn' : function(){},
		'trace' : function(){},
		'group' : function(){},
		'groupEnd' : function(){}
	};
}

/////////////////////////////////////////扩展一些方法
/**
 * 选择器
 * 根据class获取所有对象
 */
document.getElementsByClassName = function(className){
	var objs = this.getElementsByTagName('*');
	var elements = [];
	for(var i=0;i<objs.length;i++){
		if ((' '+objs[i].className+' ').indexOf(' '+className+' ')!==-1)elements.push(objs[i]);
	}
	return elements;
}
//给所有的HTML标签扩展getElementsByClassName方法
//TODO 还有很多不完善的地方
/*
if (MyQEE.is_ie){
	var HTMLElement = {prototype:{}};
	(function(){
		var run = function(){
			if (document.body){
				var create = document.createElement;
				var prototype = HTMLElement.prototype;
				document.createElement = function(type){
					var obj = create(type);
					for(var i in prototype){
						obj[i] = prototype[i];
					}
					return obj;
				}
				window.HTMLElement = document.body.getElementsByTagName('*');
				
			}else{
				setTimeout(run,10);
			}
		}
		run();
	})();
}
HTMLElement.prototype.getElementsByClassName = document.getElementsByClassName;
*/

/**
 * 返回文件大小
 */
Number.prototype.bytes = String.prototype.bytes = function(text){
	text = text || ["B","KB","MB","GB","TB","PB"];
	var c = 0;
	var a = this-0;
    while (a>=1024) {
        c++;
        a = a/1024;
    }
    return (Math.round(a*10)/10)+''+text[c];
}

/**
 * 清楚文字两端空格或指定内容
 */
String.prototype.trim = function(charlist){
	if (charlist == '' ) {
		return this.replace(/(^\s*)|(\s*$)/g, "");	
	} else {
		var re = new RegExp ('(^'+charlist+')|('+charlist+'$)','g');
		return this.replace(re, "");
	}
}

/**
 * 转换图片
 * String archiveId / fileId
 * @param size
 * @param type
 * @param imgName
 */
String.prototype.vcImage = function( size, type, imgName) {
    var regExp = /(\d+)\/([0-9a-z]{32}\d+)/i;
    var re = '';
    var url = '';
    var imgUrl = this;
    if(re = imgUrl.match(regExp)) {
        url = 'http:\/\/image-' + re[1] + '.MyQEE.com';
        if(typeof(type) != 'undefined' && type !='') {
            url += '\/' + type;
        }
        url += '\/' + re[2];
        if(typeof(size) != 'undefined' && size !='') {
            url += '(' + size + ')';
        }
        if(typeof(imgName) != 'undefined' && imgName !='') {
            url += '\/' + imgName;
        } else {
            if(typeof(size) != 'undefined' && size !='') {
                url += '\/thumb.jpg';
            } else {
                url += '\/origin.jpg';
            }
        }
        return url;
    } else {
        return MyQEE.Url.Statics.V4+'base/images/noimg-125x175.jpg';
    }
}

/**
 * 将日期格式化输出，类似php的date方法，本接口默认偏移时区为+8
 * @param str 例如 Y-m-d H:i:s
 * @param utc 偏移时区，默认+8
 */
Date.prototype.format = function(str,utc){
	str = str || 'Y-m-d H:i:s';
	if (!(utc>=-12 && utc<=12)){
		utc = 8;
	}
	utc = utc*60*60*1000;
	var d = new Date(this.getTime());
	d.setUTCMilliseconds(utc); // 服务器时区偏移 毫秒

	var dateStr = {
		Y : d.getUTCFullYear(),
		m : d.getUTCMonth()+1,
	    d : d.getUTCDate(),
	    H : d.getUTCHours(),
		i : d.getUTCMinutes(),
		s : d.getUTCSeconds()
	}
	for(var key in dateStr){
		if (dateStr[key]<10)dateStr[key] = '0'+dateStr[key];
		var regexp = new RegExp(key,'g');
		str = str.replace(regexp,dateStr[key])
	}
	return str;
}



/*导入JS*/
MyQEE.$import = function (jsfile,onloadfun,defer){
	MyQEE._IMPORT_JSFILE = MyQEE._IMPORT_JSFILE || {};
	if (!MyQEE._IMPORT_JSFILE[jsfile])
	{
		var s = 'script';
		MyQEE._IMPORT_JSFILE[jsfile] = 1;
		var html= '<'+s+' src="'+jsfile+'"'+(defer?' defer="defer"':'')+(onloadfun?(MyQEE.is_ie?' onreadystatechange="if(this.readyState!=\'complete\'){return;}'+onloadfun+'"':' onload="'+onloadfun+'"'):'')+'></'+s+'>';
		document.write(html);
	}
}

/**
 * MyQEE统计
 */
MyQEE.Track = function(url){
	try{
		pageTracker._trackPageview(url);
	}catch (e){
		console.error(e);
	}
}

/**
 * 执行初始化HTML脚本，在重新设置innerHTML后建议执行
 */
MyQEE.iniHtml = function(myobj){
	myobj = myobj||document;
	MyQEE._iniHtml_run = MyQEE._iniHtml_run||[];
	for (var _i=0;_i<MyQEE._iniHtml_run.length;_i++){
		if (typeof MyQEE._iniHtml_run[_i] == 'function'){
			try{
				MyQEE._iniHtml_run[_i](myobj);
			}catch(e){}
		}
	}
	
	//执行一次
	MyQEE._iniHtml_run_Once = MyQEE._iniHtml_run_Once||[];
	for (var _i=0;_i<MyQEE._iniHtml_run_Once.length;_i++){
		if (typeof MyQEE._iniHtml_run_Once[_i] == 'function'){
			try{
				MyQEE._iniHtml_run_Once[_i](myobj);
			}catch(e){}
		}
	}
	MyQEE._iniHtml_run_Once = [];
}


/**
 * 添加初始化HTML脚本的自定义方法
 */
MyQEE.iniHtmlAdd = function (fun){
	if (typeof fun == 'function'){
		MyQEE._iniHtml_run = MyQEE._iniHtml_run||[];
		MyQEE._iniHtml_run.push(fun);
	}
}
MyQEE.iniHtmlOnce = function (fun){
	if (typeof fun == 'function'){
		MyQEE._iniHtml_run_Once = MyQEE._iniHtml_run_Once||[];
		MyQEE._iniHtml_run_Once.push(fun);
	}
}

//初始化用户头像
MyQEE.iniHtmlAdd(
	function(){
		MyQEE._httpget_userrank_is_loading = MyQEE._httpget_userrank_is_loading || false;
		var doread = function(){
			MyQEE._httpget_userrank_is_loading = true;
			MyQEE._user_rank_arr = MyQEE._user_rank_arr||{};
			var obj = document.getElementsByName('rankimage');
			var ids = '';
			var replace = function(oo){
				var uid = oo.getAttribute('uid')-0;
				if (MyQEE._user_rank_arr['_'+uid]){
					oo.src = MyQEE.Url.Statics.V3+'images/'+MyQEE._user_rank_arr['_'+uid]['icon'];
					oo.title = MyQEE._user_rank_arr['_'+uid]['rankTitle'];
					oo.name = '';
				}
			};
			for(var i=obj.length-1;i>=0;i--){
				var uid = obj[i].getAttribute('uid')-0;
				if (uid>0){
					if (MyQEE._user_rank_arr['_'+uid]){
						//利用寄存器中的数据直接设置
						replace(obj[i]);
					}else{
						if ((ids+',').indexOf(','+uid+',')==-1){
							//防止重复的ID
							ids+=','+uid;
						}
					}
				}else{
					obj[i].name='';
				}
			}
			ids = ids.substr(1);
			if (!ids)return true;
			
			var ajax = new MyQEE.ajax(MyQEE.Url.Site+'api/member');
			ajax.setVar('m','rankInfo');
			ajax.setVar('uids',ids);
			ajax.method = 'GET';
			ajax.onCompletion = function(){
				var rs = JSON.parse(this.response);
				if (rs){
					for(var j in rs){
						MyQEE._user_rank_arr['_'+rs[j]['memberId']] = rs[j];
					}
					for(var i=obj.length-1;i>=0;i--){
						replace(obj[i]);
					}
				}
				MyQEE._httpget_userrank_is_loading = false;
			}
			ajax.onError = function(){
				MyQEE._httpget_userrank_is_loading = false;
			}
			ajax.runAJAX();
		}
		
		if (MyQEE._httpget_userrank_is_loading==true){
			//只允许但进程读取
			setTimeout(doread,100);
		}else{
			doread();
		}
	}
);
MyQEE.iniHtmlOnce(function(){MyQEE.DOM = (document.compatMode &&document.compatMode=="CSS1Compat")?document.documentElement:document.body;});

MyQEE.Member = {
	//用户空间URL
	url : function(member_id){return 'http://home.MyQEE.com/space.php?uid='+member_id},
	i_url : function(member_id){return MyQEE.Url.Root+'base/i/'+member_id+'/'},
	//用户头像URL
	avatar : function(member_id, size) {
	    if (!member_id){
	        member_id = '0';
	    }
	    if (size!='big' && size!='middle'){
	        size = 'small';
	    }
	    member_id = '_00000000'+member_id;
	    member_id = member_id.substr(member_id.length-9);
	    var dir1 = member_id.substr(0, 3);
	    var dir2 = member_id.substr(3, 2);
	    var dir3 = member_id.substr(5, 2);
	    return 'http://ucimg.vcimg.com/avatar/'+dir1+'/'+dir2+'/'+dir3+'/'+member_id.substr(member_id.length-2)+"_avatar_"+size+".jpg";
	},
	rank_img : function(member_id){
		//此方法执行完毕后，需要MyQEE.iniHtml()配合才能生效
		return '<img src="'+MyQEE.Url.Statics.V4+'global/images/spacer.gif" align="absmiddle" name="rankimage" uid="'+member_id+'" width="25" height="20" />';
	}
}




MyQEE.frameFrame = window.self;	//子窗口
MyQEE.parentFrame = window.self;	//父窗口



MyQEE.alert = function(alertset,w,h,title,handler) {
	MyQEE._set_frame();
	if (typeof (alertset) != 'object'){
		alertset = {'message':(alertset||'')};
	}
	//alertset.message = alertset.message.replace(/\n/g,'<br />');
	alertset.width = alertset.width || w;
	alertset.height = alertset.height || h;
	alertset.title = alertset.title || title || '信息提示';
	alertset.handler = alertset.handler || handler;

	if (!window.MyQEE.parentFrame.ymPrompt){
		window.alert(alertset.message);
		if (alertset.handler){
			try{alertset.handler('ok')}catch(e){}
		}
	}else{
		//try{MyQEE.parentFrame.ymPrompt.close();}catch(e){}
		if (alertset._type=='errorInfo'){
			window.MyQEE.parentFrame.ymPrompt.errorInfo(alertset);
		}else if(alertset._type=='succeedInfo'){
			window.MyQEE.parentFrame.ymPrompt.succeedInfo(alertset);
		}else if(alertset._type=='win'){
			alertset.allowSelect = alertset.allowSelect || true;		//默认允许
			alertset.allowRightMenu = alertset.allowRightMenu || true;	//默认允许
			window.MyQEE.parentFrame.ymPrompt.win(alertset);
		}else{
			window.MyQEE.parentFrame.ymPrompt.alert(alertset);
		}
		if (window.MyQEE.parentFrame)window.MyQEE.parentFrame.MyQEE.iniHtml(MyQEE.$('ym-window'));
	}
}

MyQEE.succeed = function(alertset,w,h,title,handler){
	if (typeof (alertset) != 'object'){
		alertset = {'message':(alertset||'')};
	}
	alertset.title = alertset.title || '操作成功';
	alertset._type = 'succeedInfo';
	MyQEE.alert(alertset,w,h,title,handler);
}
MyQEE.error = function(alertset,w,h,title,handler){
	if (typeof (alertset) != 'object'){
		alertset = {'message':(alertset||'')};
	}
	alertset.title = alertset.title || '错误提示';
	alertset._type = 'errorInfo';
	MyQEE.alert(alertset,w,h,title,handler);
}
MyQEE.win = function(alertset,w,h,title,handler){
	if (typeof (alertset) != 'object'){
		alertset = {'message':(alertset||'')};
	}
	alertset._type = 'win';
	alertset.middlevalign = false;
	MyQEE.alert(alertset,w,h,title,handler);
}


MyQEE.confirm = function (alertset,w,h,title,handler){
	MyQEE._set_frame();
	if (typeof (alertset) != 'object'){
		alertset = {'message':(alertset||'是否继续此操作？')};
	}
	//alertset.message = alertset.message.replace(/\n/g,'<br />');
	alertset.width = alertset.width || w;
	alertset.height = alertset.height || h;
	alertset.title = alertset.title || '请确认';
	alertset.handler = alertset.handler || handler;

	if (!MyQEE.parentFrame.ymPrompt){
		var myconform = window._confirm(alertset['message']);
		if (!alertset.handler)
		{
			return myconform;
		}else{
			var r = false;
			try{r = alertset.handler(myconform?'ok':'cancel');}catch(e){}
			return r;
		}
	}else{
		try{MyQEE.parentFrame.ymPrompt.close();}catch(e){}
		MyQEE.parentFrame.ymPrompt.confirmInfo(alertset,w,h,title,handler);
	}
}

MyQEE.closewin = function(type,autoclose){
	MyQEE._set_frame();
	try{MyQEE.parentFrame.ymPrompt.doHandler(type,autoclose);}catch(e){}
}

/**
 * 显示提示信息
 * @param string msg 信息提示内容
 * @param string 跳转到下一页url，留空则在本页直接提示，否则跳转到下一页后提示
 * @param int showtime 显示时间，单位秒，默认6
 */
MyQEE.Msg = function(msg,href,showtime){
	showtime = showtime||6;
	if (href){
		MyQEE.cookie.set('flash_message_',msg);
		document.location = href;
		return true;
	}
	if (typeof msg != 'string'){
		msg = MyQEE.cookie.get('flash_message_');
		if (msg)
			MyQEE.cookie.del('flash_message_');
	}
	if (msg){
		var runTime = 0;
		var tmpleft = 0;
		var width;
		var obj = $('MyQEE_show_msg_div_');
		
		if (MyQEE.is_ie && MyQEE.ie<7){
			//解决IE浮动问题
			var runtime = setInterval(function(){
				var rand = Math.ceil(Math.random()*10);
				obj.style.bottom = rand+'px';
				obj.style.bottom = '0px';
				},20);
		}
		
		var hidden = function (_run){
			runTime++;
			tmpleft = width * runTime/20;
			var tmpopacity = 80 - 80 * runTime/20;
			if (runTime<=20){
				obj.style.left = '-'+tmpleft+'px';
				obj.style.opacity = tmpopacity/100;
				obj.style.filter = 'alpha(opacity='+tmpopacity+')';
				setTimeout(function(){hidden(_run);},10);
			}else{
				runTime = 0;
				if (MyQEE.is_ie && MyQEE.ie<7){
					clearInterval(runtime);
				}
				MyQEE._msgRunHidden = null;
				if (typeof _run =='function'){
					try{
						_run();
					}catch(e){}
				}
			}
		}
		if (MyQEE._msgRunHidden){
			clearTimeout(MyQEE._msgRunHidden);
			width = obj.offsetWidth * 0.2;
			hidden(function(){
				MyQEE.Msg(msg,href,showtime);
			});
			return true;
		}
		if (!obj){
			obj = document.createElement('div');
			obj.style.cssText = 'position:fixed;opacity:0.01;filter:alpha(opacity=1);_position:absolute;left:0;bottom:0px;padding:3px 12px;border:1px solid #ccc;overflow:hidden;background:#FF6600;width:27%;color:#fff;text-align:left;';
			obj.id = 'MyQEE_show_msg_div_';
			document.body.appendChild(obj);
		}
		obj.innerHTML = msg;
		width = obj.offsetWidth * 0.2;
		
		var tmpleft2 = width;
		var show = function (){
			runTime++;
			tmpleft2 = tmpleft2 * 7/10;
			var tmpopacity = 80 * runTime/20;
			if (runTime<=20){
				obj.style.left = '-'+tmpleft2+'px';
				obj.style.opacity = tmpopacity/100;
				obj.style.filter = 'alpha(opacity='+tmpopacity+')';
				setTimeout(show,10);
			}else{
				obj.style.left = '0px';
				runTime = 0;
				MyQEE._msgRunHidden = setTimeout(hidden,showtime*1000);
			}
		}
		setTimeout(show,500);
	}
}
MyQEE.iniHtmlOnce(function(){MyQEE.Msg()});

MyQEE.set_win_title = function(title){
	MyQEE._set_frame();
	try{MyQEE.parentFrame.MyQEE.$('ym-tl').firstChild.firstChild.firstChild.innerHTML = title}catch(e){}
}

MyQEE.resize_win = function(w,h){
	MyQEE._set_frame();
	try{
		MyQEE.parentFrame.ymPrompt.resizeWin(w,h)
	}catch(e){}
}

MyQEE.urlpath = '/';
MyQEE.ask_del = function(id,delurl,msg){
	msg=msg||'您确认要删除此数据？';
	MyQEE.confirm(msg,400,null,'删除确认',function(tp){if (tp=='ok') goUrl( MyQEE.urlpath + delurl +'/'+id,'hiddenFrame')});
}


MyQEE._set_frame = function(){
	try {
		if( typeof(MyQEE.frameFrame.win)=='function'){
			MyQEE.parentFrame = window.parent;
		}
	}catch(e){}
	MyQEE.parentFrame.MyQEE.frameFrame = window.self;
}

MyQEE.show_loading = function(){
	var obj = this.$('_MyQEE_loading_div_');
	if (!obj){
		obj = document.createElement('div');
		obj.id = '_MyQEE_loading_div_';
		obj.style.cssText = 'z-index:10001;position: fixed;_position: absolute;top:0;left:0;text-align:center;width:100%;color:#111;font-size:14px;top:expression((eval(document.compatMode &&document.compatMode=="CSS1Compat") ?documentElement.scrollTop:document.body.scrollTop)+MyQEE._show_loading_ie6_top_);';
		obj.innerHTML = '<div style="display:inline-block;width:180px;text-align:left;"><div style="position: absolute;margin:-5px;width:180px;height:42px;background:#fff;opacity:0.8;filter:alpha(opacity=80);-moz-border-radius: 5px;-khtml-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;"></div><div style="position: absolute;"><img src="'+MyQEE.Url.Statics.V4+'global/images/loading_1.gif" align="absmiddle" /> 正在加载，请稍等...</div></div>';
		document.body.appendChild(obj);
	}
	var top = MyQEE.DOM.clientHeight/2;
	MyQEE._show_loading_ie6_top_ = top;
	obj.style.top = top +'px';
	obj.style.display = '';
}

MyQEE.hidden_loading = function(){
	var obj = this.$('_MyQEE_loading_div_');
	if (obj){
		obj.style.display = 'none';
	}
}


MyQEE.copy = function(str,alertinfo){
	//其它浏览器可使用http://code.google.com/p/zeroclipboard/提供的接口
	if (this.is_ie){
		var status = window.clipboardData.setData("Text",str);
		if (status){
			if(alertinfo)
				MyQEE.alert(alertinfo);
			return true;
		}
	}
	return false;
}



/**
 * 滑动门效果打开或关闭div
 */
MyQEE.resizeDiv = function(obj,handler){
	var objid = obj.id;
	var objnoid = false;
	if (!objid){
		objid = obj.id = '_resize_rand_'+new Date().getTime()+'_'+Math.ceil(Math.random()*100000000);
		objnoid = true;
	}
	MyQEE._resizeDiv_runNum=MyQEE._resizeDiv_runNum||{};
	if (MyQEE._resizeDiv_runNum[objid]>0){
		return false;
	}
	MyQEE._resizeDiv_runNum[objid] = 0;
	
	var type = 'hidden';
	if (obj.style.display=='none'){
		type = 'show';
	}
	var height = obj.offsetHeight;
	if (height==0){
		obj.style.visibility='hidden';
		obj.style.display='';
		//取得实际高度
		height = obj.offsetHeight;
		
		obj.style.visibility='';
	}
	var old_overflow = obj.style.overflow;
	obj.style.display='';
	obj.style.overflow='hidden';
	if (type=='show'){
		obj.style.opacity = 0;
		obj.style.filter = 'alpha(opacity=0)';
	}
	
	var tmpHeight = height;
	var changeDiv = function(){
		MyQEE._resizeDiv_runNum[objid]++;
		var runNum = MyQEE._resizeDiv_runNum[objid];
		tmpHeight = tmpHeight*4/5;
		var changeHeight;
		if (type=='show'){
			obj.style.opacity = runNum*20/100;
			obj.style.filter = 'alpha(opacity='+(runNum*10)+')';
			changeHeight = height - tmpHeight;
		}else{
			obj.style.opacity = 1-runNum*20/100;
			obj.style.filter = 'alpha(opacity='+(100-runNum*10)+')';
			changeHeight = tmpHeight;
		}
		obj.style.height = changeHeight+'px';
		if (runNum<=5){
			setTimeout(changeDiv,10);
		}else{
			if (type=='hidden'){
				obj.style.display='none';
			}
			obj.style.height='';
			obj.style.opacity = '';
			obj.style.filter = '';
			obj.style.overflow = old_overflow;
			MyQEE._resizeDiv_runNum[objid] = 0;
			delete MyQEE._resizeDiv_runNum[objid];
			if (handler){
				try{handler();}catch(e){}
			}
			if (objnoid){
				obj.id='';
			}
		}
	}
	changeDiv();
}

MyQEE.login = function() {
	var ajax = new MyQEE.ajax('/base/ajax/login');
	ajax.method = 'POST';
	ajax.onCompletion = function (){
        var config = JSON.parse(this.response);
        if (typeof config == 'object'){
            MyQEE.win({'message':config.message, 'width':400, 'height':170, 'title':config.title});
        } else {
            MyQEE.error('抱歉，返回数据错误，请重试！');
        }
    }
	ajax.runAJAX();
}


MyQEE._innerhtml_global_html_pool = [];
MyQEE._innerhtml_global_script_pool = [];
MyQEE._innerhtml_global_script_src_pool = [];
MyQEE._innerhtml_global_lock_pool = [];
MyQEE._innerhtml_innerhtml_lock = null;
MyQEE._innerhtml_document_buffer = "";
/**
 * 插入需要支持JS的html，支持绝大部分浏览器
 */
MyQEE.innerHTML = function ( obj, html , time) {
    if (!obj.id){
    	obj.id = '_innerhtml_tmpid_'+Math.ceil(Math.random()*100000000);
    }
    obj.innerHTML = html;
    set_innerHTML(obj.id,html);
}

var global_html_pool = [];
var global_script_pool = [];
var global_script_src_pool = [];
var global_lock_pool = [];
var innerhtml_lock = null;
var document_buffer = "";
function set_innerHTML(obj_id, html, time) {
if (innerhtml_lock == null) {
innerhtml_lock = obj_id;
}
else if (typeof(time) == "undefined") {
global_lock_pool[obj_id + "_html"] = html;
window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html']);", 10);
return;
}
else if (innerhtml_lock != obj_id) {
global_lock_pool[obj_id + "_html"] = html;
window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html'], " + time + ");", 10);
return;
}
function get_script_id() {
return "script_" + (new Date()).getTime().toString(36)
+ Math.floor(Math.random() * 100000000).toString(36);
}
document_buffer = "";
document.write = function (str) {
document_buffer += str;
}
document.writeln = function (str) {
document_buffer += str + "\n";
}
global_html_pool = [];
var scripts = [];
html = html.split(/<\/script>/i);
for (var i = 0; i < html.length; i++) {
global_html_pool[i] = html[i].replace(/<script[\s\S]*$/ig, "");
scripts[i] = {text: '', src: '' };
scripts[i].text = html[i].substr(global_html_pool[i].length);
scripts[i].src = scripts[i].text.substr(0, scripts[i].text.indexOf('>') + 1);
scripts[i].src = scripts[i].src.match(/src\s*=\s*(\"([^\"]*)\"|\'([^\']*)\'|([^\s]*)[\s>])/i);
if (scripts[i].src) {
if (scripts[i].src[2]) {
scripts[i].src = scripts[i].src[2];
}
else if (scripts[i].src[3]) {
scripts[i].src = scripts[i].src[3];
}
else if (scripts[i].src[4]) {
scripts[i].src = scripts[i].src[4];
}
else {
scripts[i].src = "";
}
scripts[i].text = "";
}
else {
scripts[i].src = "";
scripts[i].text = scripts[i].text.substr(scripts[i].text.indexOf('>') + 1);
scripts[i].text = scripts[i].text.replace(/^\s*<\!--\s*/g, "");
}
}
var s;
if (typeof(time) == "undefined") {
s = 0;
}
else {
s = time;
}
var script, add_script, remove_script;
for (var i = 0; i < scripts.length; i++) {
var add_html = "document_buffer += global_html_pool[" + i + "];\n";
script = document.createElement("script");
if (scripts[i].src) {
script.src = scripts[i].src;
if (typeof(global_script_src_pool[script.src]) == "undefined") {
global_script_src_pool[script.src] = true;
s += 2000;
}
else {
s += 10;
}
}
else {
script.text = scripts[i].text;
s += 10;
}
script.defer = true;
script.type =  "text/javascript";
script.id = get_script_id();
global_script_pool[script.id] = script;
add_script = add_html;
add_script += "document.getElementsByTagName('head').item(0)";
add_script += ".appendChild(global_script_pool['" + script.id + "']);\n";
window.setTimeout(add_script, s);
remove_script = "document.getElementsByTagName('head').item(0)";
remove_script += ".removeChild(document.getElementById('" + script.id + "'));\n";
remove_script += "delete global_script_pool['" + script.id + "'];\n";
window.setTimeout(remove_script, s + 10000);
}
var end_script = "if (document_buffer.match(/<\\/script>/i)) {\n";
end_script += "set_innerHTML('" + obj_id + "', document_buffer, " + s + ");\n";
end_script += "}\n";
end_script += "else {\n";
end_script += "innerhtml_lock = null;\n";
end_script += "}";
window.setTimeout(end_script, s);
}


/**
 * 多标签切换
 */
MyQEE.tag = function(thisid,titlePrefix,mainPrefix,searchID,classname){
	var mainobj;
	if (searchID)
	{
		if (typeof searchID == 'object')
		{
			mainobj = searchID;
		}else{
			mainobj = MyQEE.$(searchID) || document.body;
		}
	}else{
		mainobj = document.body;
	}
	classname = classname || 'now';
	var el = mainobj.getElementsByTagName("li");
	for (var i=0;i<el.length;i++)
	{
		if (el[i].id)
		{
			if (el[i].id.substr(0,titlePrefix.length+1) == titlePrefix+'_')
			{
				var thisTitleId = el[i].id.substr(titlePrefix.length);
				var mainobj = MyQEE.$(mainPrefix + thisTitleId);
				if (el[i].id != thisid)
				{
					el[i].className = '';
					if (mainobj)
					{
						mainobj.style.display = 'none';
					}
				} else {
					el[i].className = classname;
					if (mainobj)
					{
						mainobj.style.display = '';
					}
				}
			}
		}
	}
}

/**
 * 判断当前页面是否在frame里
 */
MyQEE.isinFrame = function(){
	try{
		if(document.location!=parent.location && parent.window.name.indexOf('framemain_')){
			return true;
		}
	}catch(e){}
	return false;
}

/**
 * 获取cookie
 */
MyQEE.cookie = {
	get : function (name){
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for (var i = 0; i < ca.length; i++) {
			var c = ca[i];
			while (c.charAt(0) == ' ') 
				c = c.substring(1, c.length);
			if (c.indexOf(nameEQ) == 0) 
				return decodeURIComponent(c.substring(nameEQ.length, c.length));
		}
		return null;
	},
	set : function (name, value, days, path){
		var expires = "";
		if (days) {
			var date = new Date();
			date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
			expires = "; expires=" + date.toGMTString();
		};
		path = path || '/';
		document.cookie = name + "=" + encodeURIComponent(value) + expires + ";path=" + path;
	},
	del : function (name){
		var exp = new Date();   
		exp.setTime (exp.getTime() - 99999);
		document.cookie = name + "=''; expires=" + exp.toGMTString()+';path=/';
	}
}

/**
 * 输出Flash
 * @param id flashID或容器ID，传入NULL时采用document.write输出
 * @param url flash url地址
 * @param w 宽度 可用百分比
 * @param h 高度 同上
 * @param p 是否不透明，0为透明，1表示不透明
 * @param rightmenu 右键菜单 0为显示菜单，1为屏蔽
 * @param flashvars 传递falshvar参数
 * @param other 其它自定义参数，用object传递
 * @return
 */
MyQEE.flash = function(id,url,w,h,p,rightmenu,flashvars,other){
	id=id||'';
	var obj=this.$(id);
	p=(!p)?'Transparent':'Opaque';
	rightmenu=(!rightmenu)?true:false;
	flashvars=flashvars||'';
	if(typeof other !='object'){
		other = {};
	}
	other['allowscriptaccess'] = other['allowscriptaccess']||'sameDomain';
	var str1='',str2='';
	for(var k in other){
		str1+='<param name="'+k+'" value="'+other[k]+'">';
		str2+=' '+k+'="'+other[k]+'"';
	}

	var tmphtml='<object id="'+(obj?id+'_flash"':id)+'" filetype="swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'"><param name="movie" value="'+url+'"><param name="wmode" value="'+p+'"><param name="menu" value="'+rightmenu+'"><param name="FlashVars" value="'+flashvars+'">'+str1+'<embed name="'+(obj?id+'_flash':id)+'" src="'+url+'" width="'+w+'" height="'+h+'" wmode="'+p+'" flashvars="'+flashvars+'" menu="'+rightmenu+'"'+str2+' type="application/x-shockwave-flash" /></object>';
	if (obj!=null){
		obj.innerHTML = tmphtml;
	}else{
		document.write(tmphtml);
	}
}

MyQEE.get_flash = function(objname){
	if (document[objname]){
		return document[objname];
	}else{
		return this.$((objname));
	}
}

/**
 * AJAX
 */
MyQEE.ajax = function(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Array();
		this.responseStatus = new Array(2);
		this.renewData = false;
		this.needresetvar = false;
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		if (this.requestFile){
			if (this.requestFile.substr(0,7).toLowerCase()=='http://'||this.requestFile.substr(0,8).toLowerCase=='https://'){
				var host = this.requestFile.split('/')[2];
				if (host!=document.location.host){
					this.createFlashAjax();
				}
			}
		}
		if (this.xmlhttp){
			return true;
		}
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.createFlashAjax();
			}
		}
	};
	
	this.createFlashAjax = function(){
		var swfrand = '';
		if (MyQEE.is_ie){
			swfrand = '?r='+new Date().getTime();
		}
		if (!this.flashobj){
			var obj = MyQEE.$('_ajax_fdiv');
			if (!obj){
				obj = document.createElement('DIV');
				obj.id='_ajax_fdiv';
				//Window的firefox里必须在可见区域，且不容许隐藏，很变态，2010-6-11 by jonwang
				obj.style.cssText = 'position:fixed;_position:absolute;top:100px;left:0px;opacity:0.01;';
				//防止IE在没有加载完全后出错
				document.body.insertBefore(obj,$('header_div'));
			}
			if (!MyQEE.get_flash('_ajax_fdiv_flash')){
				MyQEE.flash('_ajax_fdiv','/base/images/swf/ajaxcdr.swf'+swfrand,1,1,null,null,null,{'allowscriptaccess':'always','swliveconnect':'true','bgcolor':'#ffffff'});
			}
			this.flashobj = MyQEE.get_flash('_ajax_fdiv_flash');
		}
		var time = new Date().getTime();
		time = time +'_'+ Math.round(Math.random()*10000);
		if (this.flashobj.is_loading==true){
			obj = document.createElement('DIV');
			obj.id='_ajax_fdiv_'+time;
			obj.style.cssText = 'position:fixed;_position:absolute;top:100px;left:0px;opacity:0.01;';
			document.body.insertBefore(obj,$('header_div'));
			MyQEE.flash('_ajax_fdiv_'+time,'/base/images/swf/ajaxcdr.swf'+swfrand,1,1,null,null,null,{'allowscriptaccess':'always','swliveconnect':'true'});
			this.flashobj = MyQEE.get_flash('_ajax_fdiv_'+time+'_flash');
		}
		var self = this;
		if (typeof MyQEE._flashAjaxCallback != 'object'){
			MyQEE._flashAjaxCallback = [];
		}
		this.xmlhttp = new function(){
			this.method = self.method;
			this.url = self.requestFile;
			this.randid = time;
			this.open = function(method, url){
				self.method = method||self.method;
				self.requestFile = url||self.requestFile;
				self.xmlhttp.randid = time;
			};
			this.send = function(urlstring){
				self.flashobj.is_loading = true;
				self.xmlhttp.readyState = 1;
				self.xmlhttp.onreadystatechange();
				var tryNum = 0;
				var loadhttp = function(){
					setTimeout(function(){
						tryNum++;
						if (self.flashobj.XmlHttp){
							self.flashobj.XmlHttp(self.requestFile , 'MyQEE._flashAjaxCallback["'+self.xmlhttp.randid+'"]' , self.method , urlstring, 'application/x-www-form-urlencoded');
						}else{
							//3秒钟
							if (tryNum<300){
								loadhttp();
							}else{
								//错误
								self.flashobj.is_loading = false;
								self.xmlhttp.responseText = '';
								self.xmlhttp.readyState = 4;
								self.xmlhttp.status = '500';
								self.xmlhttp.onreadystatechange();
								delete MyQEE._flashAjaxCallback[time];
							}
						}
					},10);
				}
				loadhttp();
			};
		};
		MyQEE._flashAjaxCallback[time] = function(){
			self.flashobj.is_loading = false;
			self.xmlhttp.responseText = self.flashobj.GetVariable("retText");
			self.xmlhttp.readyState = 4;
			self.xmlhttp.status = '200';
			self.xmlhttp.onreadystatechange();
			delete MyQEE._flashAjaxCallback[time];
		}
	};
	
	this.setVar = function(name, value){
		if (this.needresetvar==true){
			this.vars = new Array();
			this.needresetvar =false;
		}
		this.vars[this.vars.length] = Array(name,value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			if (this.needresetvar==true){
				this.vars = new Array();
				this.needresetvar =false;
			}
			this.vars[this.vars.length] = Array( encodeURIComponent(name), encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			var urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1] );
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		if (this.method == 'GET' && this.renewData==true){
			// prevents caching of URLString
			this.setVar("rndval", new Date().getTime());
		}

		var urlstringtemp = new Array();
		for (var key=0;key<this.vars.length;key++) {
			var thekey = this.vars[key][0];
			var thevalue = this.vars[key][1];
			if (false == this.vars[key][2] && true == this.encodeURIString) {
				var encoded = this.encVar(thekey,thevalue,true);
				thekey = encoded[0];
				thevalue = encoded[1];
			}
			urlstringtemp[urlstringtemp.length] = thekey + "=" + thevalue;
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			this.createAJAX();
			
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					if (this.URLString){
						totalurlstring = this.requestFile + (this.requestFile.indexOf('?')>=0 ? this.argumentSeparator : this.queryStringSeparator ) + this.URLString;
					}else{
						totalurlstring = this.requestFile;
					}
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", 'application/x-www-form-urlencoded');
					} catch (e) { }
				}
				try {
					this.xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
				}catch (e) { }

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
				this.needresetvar = true;
			}
		}
	};

	this.stop = function (){
		this.onError = function(){};
		this.xmlhttp.abort();
		if (this.onStop)
		{
			this.onStop();
		}
	}

	this.setform = function(formname){
		var obj;
		if(typeof formname =='object'){
			obj = formname;
		}else{
			obj = document.forms[formname];
			if (!obj){
				obj = document.getElementById(formname);
				if (!obj)return;
				if (obj.tagName!='form')obj = null;
			}
		}
		if (!obj)return;
		
		var myform = obj.elements;

		var tt=0
		for (var i=0;i<myform.length;i++){
			if (myform[i].disabled)continue;
			if (myform[i].name){
				if (myform[i].type=='checkbox' || myform[i].type=='radio'){
					if (myform[i].checked) this.setVar(myform[i].name,myform[i].value);
				}else if (myform[i].type.substr(0,6)=='select'){
					for(var k=0;k<myform[i].options.length;k++){
						if (myform[i].options[k].selected){
							this.setVar(myform[i].name,myform[i].options[k].value);
						}
					}
				}else{
					this.setVar(myform[i].name,myform[i].value);
				}
			}
		}
	}

	this.submit = function (theform,hander){
		if (!theform)return;
		this.reset();
		this.setform(theform);
		this.method = (theform.method||'POST').toUpperCase();
		this.requestFile = theform.action;
		this.onCompletion = function (){
			alert('提交成功！');
		}
		if (typeof hander == 'object'){
			this.onLoading = hander.onLoading || this.onLoading;
			this.onLoaded = hander.onLoaded || this.onLoaded;
			this.onInteractive = hander.onInteractive || this.onInteractive;
			this.onCompletion = hander.onCompletion || this.onCompletion;
			this.onError = hander.onError || this.onError;
			this.onFail = hander.onFail || this.onFail;
		}
		this.runAJAX();
		return false;
	}

	this.reset();
}



/*
---------------------------------------------------------- json2.js begin --------------------
    json2.js
    2007-11-06

    Public Domain

    No warranty expressed or implied. Use at your own risk.

    See http://www.JSON.org/js.html

    This file creates a global JSON object containing two methods:

        JSON.stringify(value, whitelist)
            value       any JavaScript value, usually an object or array.

            whitelist   an optional that determines how object values are
                        stringified.

            This method produces a JSON text from a JavaScript value.
            There are three possible ways to stringify an object, depending
            on the optional whitelist parameter.

            If an object has a toJSON method, then the toJSON() method will be
            called. The value returned from the toJSON method will be
            stringified.

            Otherwise, if the optional whitelist parameter is an array, then
            the elements of the array will be used to select members of the
            object for stringification.

            Otherwise, if there is no whitelist parameter, then all of the
            members of the object will be stringified.

            Values that do not have JSON representaions, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped, in arrays will be replaced with null. JSON.stringify()
            returns undefined. Dates will be stringified as quoted ISO dates.

            Example:

            var text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'

        JSON.parse(text, filter)
            This method parses a JSON text to produce an object or
            array. It can throw a SyntaxError exception.

            The optional filter parameter is a function that can filter and
            transform the results. It receives each of the keys and values, and
            its return value is used instead of the original value. If it
            returns what it received, then structure is not modified. If it
            returns undefined then the member is deleted.

            Example:

            // Parse the text. If a key contains the string 'date' then
            // convert the value to a date.

            myData = JSON.parse(text, function (key, value) {
                return key.indexOf('date') >= 0 ? new Date(value) : value;
            });

    This is a reference implementation. You are free to copy, modify, or
    redistribute.

    Use your own copy. It is extremely unwise to load third party
    code into your pages.
*/

/*jslint evil: true */
/*extern JSON */

if (!this.JSON) {

    JSON = function () {

        function f(n) {    // Format integers to have at least two digits.
            return n < 10 ? '0' + n : n;
        }

        Date.prototype.toJSON = function () {

// Eventually, this method will be based on the date.toISOString method.

            return this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z';
        };


        var m = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        };

        function stringify(value, whitelist) {
            var a,          // The array holding the partial texts.
                i,          // The loop counter.
                k,          // The member key.
                l,          // Length.
                r = /["\\\x00-\x1f\x7f-\x9f]/g,
                v;          // The member value.

            switch (typeof value) {
            case 'string':

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe sequences.

                return r.test(value) ?
                    '"' + value.replace(r, function (a) {
                        var c = m[a];
                        if (c) {
                            return c;
                        }
                        c = a.charCodeAt();
                        return '\\u00' + Math.floor(c / 16).toString(16) +
                                                   (c % 16).toString(16);
                    }) + '"' :
                    '"' + value + '"';

            case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

                return isFinite(value) ? String(value) : 'null';

            case 'boolean':
            case 'null':
                return String(value);

            case 'object':

// Due to a specification blunder in ECMAScript,
// typeof null is 'object', so watch out for that case.

                if (!value) {
                    return 'null';
                }

// If the object has a toJSON method, call it, and stringify the result.

                if (typeof value.toJSON === 'function') {
                    return stringify(value.toJSON());
                }
                a = [];
                if (typeof value.length === 'number' &&
                        !(value.propertyIsEnumerable('length'))) {

// The object is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                    l = value.length;
                    for (i = 0; i < l; i += 1) {
                        a.push(stringify(value[i], whitelist) || 'null');
                    }

// Join all of the elements together and wrap them in brackets.

                    return '[' + a.join(',') + ']';
                }
                if (whitelist) {

// If a whitelist (array of keys) is provided, use it to select the components
// of the object.

                    l = whitelist.length;
                    for (i = 0; i < l; i += 1) {
                        k = whitelist[i];
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                } else {

// Otherwise, iterate through all of the keys in the object.

                    for (k in value) {
                        if (typeof k === 'string') {
                            v = stringify(value[k], whitelist);
                            if (v) {
                                a.push(stringify(k) + ':' + v);
                            }
                        }
                    }
                }

// Join all of the member texts together and wrap them in braces.

                return '{' + a.join(',') + '}';
            }
        }

        return {
            stringify: stringify,
            parse: function (text, filter) {
                var j;

                function walk(k, v) {
                    var i, n;
                    if (v && typeof v === 'object') {
                        for (i in v) {
                            if (Object.prototype.hasOwnProperty.apply(v, [i])) {
                                n = walk(i, v[i]);
                                if (n !== undefined) {
                                    v[i] = n;
                                }
                            }
                        }
                    }
                    return filter(k, v);
                }


// Parsing happens in three stages. In the first stage, we run the text against
// regular expressions that look for non-JSON patterns. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
// because it can cause mutation. But just to be safe, we want to reject all
// unexpected forms.

// We split the first stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace all backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

                if (/^[\],:{}\s]*$/.test(text.replace(/\\./g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the second stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                    text==''?'':j = eval('(' + text + ')');

// In the optional third stage, we recursively walk the new structure, passing
// each name/value pair to a filter function for possible transformation.

                    return typeof filter === 'function' ? walk('', j) : j;
                }

// If the text is not JSON parseable, then a SyntaxError is thrown.

				return [];
                throw new SyntaxError('parseJSON');
            }
        };
    }();
}

/*
---------------------------------------------------------- json2.js end --------------------
*/









/*
---------------------------------------------------------- prototype --------------------
*/
if(!MyQEE.is_ie){
    HTMLElement.prototype.__defineGetter__("innerText",
    function(){
        var anyString = "";
        var childS = this.childNodes;
        for(var i=0; i<childS.length; i++) {
            if(childS[i].nodeType==1)
                //anyString += childS[i].tagName=="BR" ? "\n" : childS[i].innerText;
                anyString += childS[i].innerText;
            else if(childS[i].nodeType==3)
                anyString += childS[i].nodeValue;
        }
        return anyString;
    }
    );
    HTMLElement.prototype.__defineSetter__("innerText",
    function(sText){
        this.textContent=sText;
    }
    );
}


var _scroll = window.scroll;
/**
 * 实现滑动门效果的滚动，覆盖系统自带的方法
 */
window.scroll = function(x,y){
	if (MyQEE._scroll_runNum_>0){
		return true;
	}
	MyQEE._scroll_runNum_ = 0;
	var runNum = MyQEE._scroll_runNum_;
	var scrollX = MyQEE.DOM.scrollLeft || document.body.scrollLeft;
	var scrollY = MyQEE.DOM.scrollTop || document.body.scrollTop;
	var tmpX = scrollX-x;
	var tmpY = scrollY-y;
	var scroll = function(){
		runNum++;
		var newX = 0;
		var newY = 0;
		if (tmpY<0){
			//向下移
			scrollY = scrollY - tmpY/5;
			newY = scrollY;
			tmpY = tmpY*4/5;
		}else{
			//向上移
			tmpY = tmpY*4/5;
			newY = y + tmpY;
		}
		if (runNum<=20){
			_scroll(newX,newY);
			setTimeout(scroll,10);
		}else{
			_scroll(x,y);
		}
	}
	scroll();
}

MyQEE.scroll = scroll;